<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      :class="{
        content3: !props.info.value && !props.info.remarks && props.info.subTitle,
        content2: !props.info.value && !props.info.remarks && !props.info.subTitle,
      }"
      class="content outline-parent-bg"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style10/Level1outlineStyle2Bg.webp'})`,
      }"
    >
      <div
        class="Showroom-parent"
        :class="{ 'Showroom-parent1': route.meta.loopType }"
        v-if="props.info.digitalShowroom"
      >
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div
        class="title-box"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style10/Level1outlineStyle2Bgtitle1.webp'})`,
        }"
      >
        <p>{{ props.info.text }}</p>
      </div>
      <p
        class="subtitle"
        :class="{
          'subtitle-2': !props.info.value,
        }"
        v-if="props.info.subTitle"
      >
        {{ props.info.subTitle }}
      </p>

      <div
        :style="{
          backgroundImage: `url(${
            publicUrls +
            (!props.info.remarks
              ? 'free/style10/Level1outlineStyle2Bgimg2.png?imageView2/format/webp'
              : 'free/style10/Level1outlineStyle2Bgimg1.png?imageView2/format/webp')
          })`,
        }"
        class="img-box"
        :class="{
          'img-box1': props.info.remarks && !props.info.subTitle,
          'img-box2': !props.info.remarks && props.info.subTitle,
          'img-box3': !props.info.remarks && !props.info.subTitle,
        }"
        v-if="props.info.value"
      >
        <div class="outline-cover">
          <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
        </div>
      </div>
      <div class="remarks1" v-if="props.info.value">
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="getRemarksNum(5, route.meta.loopType)"
        ></TextMax>
      </div>
      <div
        class="remarks2"
        :class="{
          remarks3: !props.info.subTitle,
        }"
        v-else-if="props.info.remarks"
      >
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="!props.info.subTitle ? getRemarksNum(16, route.meta.loopType) : getRemarksNum(13, route.meta.loopType)"
        ></TextMax>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free3Style1',
});
</script> 
   
<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style10.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax10.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 200px;
  // margin-left: 120px;
  margin-top: 0;
}
.content {
  display: flex;
  flex-direction: column;
  width: 721px;
  height: 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  // box-shadow: 8px 6px 4px 0px rgba(2, 2, 2, 0.1);
  padding: 173px 183px 67px 56px;
}
.content2 {
  .title-box {
    margin-top: calc(406px - 173px);
    margin-left: calc(137px - 56px);
  }
}
.content3 {
  .title-box {
    margin-top: calc(406px - 173px);
    margin-left: calc(137px - 56px);
  }
  .subtitle {
    margin-top: 20px;
    text-align: center;
  }
}
.Showroom-parent {
  display: flex;
  position: absolute;
  top: 200px;
  right: 39px;
  z-index: 15;
  width: 51px;
  height: 89px;
  top: 198px;
  right: 88px;
}
.Showroom-parent1 {
  top: 207px;
  right: 88px;
}
.title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 381px;
  height: 88px;
  background-size: 100% 100%;
  background-repeat: no-repeat;

  :deep(p) {
    width: 262px;
    font-family: SJxingkai-C;
    font-size: 30px;
    color: rgba(57, 56, 54, 1);
    line-height: 30px;
    text-align: center;
    letter-spacing: -0.04em;
  }
}
.title-box-2 {
  padding: 16px 25px;
  display: flex;
  justify-content: space-between;
  width: 488px;
  height: 128px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.subtitle {
  width: 482px;
  font-family: PingFang SC;
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
  text-align: center;
  margin-top: 10px;
  color: rgba(57, 56, 54, 1);
}
.img-box {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  width: 482px;
  height: 306px;
  background: rgba(57, 56, 54, 0.1);

  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 482px;
    height: 100%;
    overflow: hidden;
    img {
      transition: all 0.3s;
      width: 482px;
      max-height: 100%;
      height: auto;
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.3);
    }
  }
}
.img-box1 {
  height: 372px;
}
.img-box2 {
  height: 453px;
}
.img-box3 {
  height: 497px;
}
.remarks1 {
  width: 482px;
  margin-top: 20px;
}
.remarks2 {
  width: 482px;
  margin-top: 20px;
}
.remarks3 {
  margin-top: 20px;
}
</style>
